import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import Admin from '../views/Admin/Admin.vue'
Vue.use(VueRouter)

const routes = [{
	path: '/',
	name: 'Home',
	component: Home,
	redirect: '/index',
	children: [{
		path: '/admin',
		name: 'Admin',
		component: Admin,
		children: [{
				path: '/peixun',
				name: 'Peixun',
				component: () => import('../views/Admin/Peixun.vue')
			},
			{
				path: '/index',
				name: 'Index',
				component: () => import('../views/Admin/Index.vue')
			},
			{
				path: '/baoming',
				name: 'Baoming',
				component: () => import('../views/Admin/Baoming.vue')
			},
			{
				path: '/qiandao',
				name: 'Qiandao',
				component: () => import('../views/Admin/Qiandao.vue')
			},
			{
				path: '/jifen',
				name: 'Jifen',
				component: () => import('../views/Admin/Jifen.vue')
			},
			{
				path: '/diannao',
				name: 'Diannao',
				component: () => import('../views/Admin/Diannao.vue')
			},
			{
				path: '/101',
				name: '101js',
				component: () => import('../views/Admin/101.vue')
			},
			{
				path: '/102',
				name: '102js',
				component: () => import('../views/Admin/102.vue')
			}
		],
	}]
}]

const router = new VueRouter({
	mode: 'history',
	base: process.env.BASE_URL,
	routes
})

export default router
